{$header}
<php>
	$order_id = getModelName($_REQUEST['id'],'order_detail','order_id'); 
	$order = M('Order');
	$order->getById($order_id);

	function getBuyId($orderdetail_id){
		$buyid = M('Buy')->where('order_detail_id = '.$orderdetail_id)->getField('id');
		return $buyid;
	}
</php>

<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">销售订单号<strong>{:$order->mano}</strong>打包操作[ <a href="__APP__/Shipping">返回发货列表</a> ] 
  </h3>
<div id="result" class="result none"></div>
<form class="form-horizontal well" method='post' id="form1" name="form1" action="__URL__/insert/">
<table class="table table-bordered table-striped">
	<input type="hidden" name="order_id" value="{$order_id}" >
	<tr>
		<td>客户</td><td>{:getModelName($order->customer_id,'Customer')}</td>
		<td>地址</td><td>{:$order->address}</td>
	</tr>
	<tr>
		<td>包装后总重量</td><td><input type="text" class="span1" name="weight" > {:modList('Unit')}</td>
		<td>货值</td><td> 待定 {:getConfigVal($order->currency,'currency')} </td>
	</tr>
	
	<tr>
		<td>备注</td><td colspan="3"> <textarea name="remark" class="span7" rows=3></textarea> </td>
	</tr>
	<tr>
		<td>经办人</td>
		<td>{:modList('User')}
			<input type="hidden" name="status" value="1">
		</td>
		
	</tr>
</table>
<php>
	$product = M('Product');
	
</php>
<h3 class="heading">包装明细</h3>
		<table class="table table-bordered table-striped">
			<tr><th>产品中文</th><th>英文名称</th><th>CAS</th><th>数量</th><th>单位</th><th>小计</th></tr>
			<volist name="vo" id="ca">
				<php> $product->getById($ca['product_id']);</php>
				<tr>
					<input type="hidden" name="product_id[]" value="{$ca.product_id}" >
					<input type="hidden" name="order_detail_id[]" value="{$ca.id}" >
				<td>{:$product->name}</td>
				<td>{:$product->ename}</td>
				<td>{:$product->cas}</td>
				<td><input type="text" name="number[]" value="{$ca.number}" class="span1"> </td>
				<td>{$ca.unit_id|getModelName='Unit'}</td>
				<td><input type="text" name="total[]" class="span1" value="{$ca.total} ">{$ca.order_id|getModelName='Order','currency'|getConfigVal='currency'}</td>
				
				</tr>
			</volist>
			<tr>
				<td></td>
				<td colspan=5>
					<button type="submit" class="btn btn-primary"> <i class="icon-ok icon-white"></i>
						打包
					</button>
					<a class="btn btn-primary offset1" href="__URL__"> <i class="icon-arrow-left icon-white"></i>
						返回
					</a>
				</td>
			</tr>
		</table>
	</form>
</div>
<include file="Public:footer" />
